Vision systems are widely used for e.g. detecting defects of objects or measuring presence and position of an object placed on a carrier. Such systems comprise a camera or imaging sensor and a light source arranged to illuminate an object to be measured with incident light. Reflected light from the object is detected by the camera and, thus, an image of the object is created. There is often a requirement for imaging multiple characteristics of the same object, such as various three-dimensional (3D) and two-dimensional (2D) characteristics. In the 3D image geometrical characteristics such as width, height, volume etc. of the object are imaged. In the 2D image characteristics such as cracks, structural orientation, position and identity are imaged, for example, through marks, bar code or matrix code. Intensity information in the 2D image is usually imaged in grey scale, but imaging the 2D image in colour, that is to say registering R (red), G (green) and B (blue) components, for example, by means of wavelength-selective filters or light source wavelengths is also common.
Three-dimensional imaging or range imaging is used to obtain a set of range values and the pixel values of a range image represent the distance between the camera “or a fix point” and the measured object. There are a number of well-known techniques for measuring range data. These include laser triangulation, structured light imaging, time-of-flight measurements and stereo imaging.
Further, it is possible to measure scattering of the incident light in the surface layer of the object. That is to say, the light penetrating the material of the object and after scattering is registered when it emerges from the material at a different location from that at which it entered. How this occurs depends on the internal characteristics of the material. When the object and the artefact consist of different types of materials or different internal structures, the incident light scatters differently within the material and, thus, defects of the object is identified by measuring the scattered light. It is to be noted that the term scatter in this context is not to be confused with light diffusively reflected from the surface.
One prior art approach is shown in EP 765 471, which discloses an arrangement and a method for the detection of defects in timber. Here a light source is used in the optical axis, i.e. in the same axis as the sensor when measuring, and separate sensor rows, covering separate virtual lines on the object, for directly reflected light and scattered light are sampled. This method gives very good results if correctly tuned but is difficult to setup and tune.
Another prior art approach is shown in EP 1 432 961, which discloses a method and an arrangement enabling an efficient measurement of objects using triangulation wherein data is outputted and processed from a window around the maximum intensity peak. The disclosed method and arrangement requires that all data around the peak is kept so that it may be used to determine the intensity of the scattered light at a fixed position related to the found peak maximum. Typically the raw window data may be extracted within the sensor, but must be exported to an outside source for further processing, which lowers performance and adds complexity.
These previously known methods to measure scattered light are illustrated in FIG. 4a, which shows an image of an object captured on a two-dimensional sensor. The sensor detects both the light scattered in the regions S1 and S2 in the object and the reflected light R on the object. On both sides of the reflected light R an area of scattered light appears which can be seen in FIG. 4a as S. The intensities (signal strengths) of the reflected light R and the scattered light S1 and S2 in the captured image in FIG. 4a are shown in FIG. 4b. 
If the complete image is retrieved from the sensor, the processing to find the intensity of the scattered and reflected light is made by an external signal-processing unit. The output of raw sensor information limits, however, the possible sampling speed. If the sensor has random access capability it is possible to extract only the interesting regions from the sensor, thus retrieving a smaller amount of data from the sensor and a possibility to reach a greater sampling speed. With some sensors it is also possible to have different exposure time and/or read-out amplification for the two regions and also to sum the scattered light from a number of rows to further increase the signal strength.
The scattered light may be collected on one side, S1 or S2, of the reflected light or summed up from both sides, S1 and S2, to further increase the signal strength. If a point light source is used, a multitude of positions around the point may be used together or independent of each other to determine the amount of scattered light.
Efficient measurement of the amount of scattered light is difficult in a triangulation system, since it is necessary to measure the intensity of detected light at a fixed position away from the incoming light as can be seen in FIG. 4b. 